<?php

namespace Hilaoyu\LaravelExtend\Services\Auth\Controllers;

use Hilaoyu\LaravelExtend\ControllerBase;
use Hilaoyu\LaravelExtend\Services\Auth\AuthService;
use Hilaoyu\Utils\UtilSupport;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;

class ConfigController extends ControllerBase
{
    
    public function guardConfig(Request $request){
        
        $config = AuthService::GetGuardProviderConfig(AuthService::GuardKey());

        if(!$config){
            $config = [];
        }

        $config = Arr::only($config,[
            'single_client_login',
            'allow_account_login',
            'login_use_image_captcha',
            'allow_mobile_login',
            'allow_email_login',

            'allow_third_path_login',

            'allow_register',
            'register_need_mobile',
            'register_check_mobile',
            'register_need_email',
            'register_check_email',
            'allow_mobile_reset_pass',
            'allow_email_reset_pass',
        ]);
        comResponse()->success()->with($config);

        return $this->renderingResponse();
    }
}
